Skip to content

Conversation

@wkliao
Copy link
Collaborator

@wkliao wkliao commented Jul 21, 2025

This PR is to enable darshan-config utility program to show all configured options used when Darshan is built.

Below are the changes when using this configure command:

../darshan/configure --prefix=$HOME/Darshan/DEV \
                     --with-jobid-env=NONE \
                     --with-log-path=$HOME/Darshan/LOG \
                     --with-log-path-by-env=DARSHAN_LOG1,DARSHAN_LOG2 \
-                     -with-mod-mem=64 \
                     --with-name-mem=16 \
                     --with-username-env=JOHNDOE \
                     --with-zlib=$ZLIB_DIR \
                     --silent \
                     --enable-pnetcdf-mod --with-pnetcdf=$PNETCDF_DIR \
                     --enable-hdf5-mod    --with-hdf5=$HDF5_DIR \
                     CFLAGS="-O0 -g -Wfatal-errors -Wall" \
                     UTIL_CC=gcc RUNTIME_CC=cc

Command darshan-config --all now shows all options used at Darshan's configure time.

(click to expand)

This Darshan Runtime 3.4.7 was built with the following features:

  --ld-preload            -> yes
  --cuserid               -> no
  --group-readable-logs   -> no
  --mmap-logs             -> no
  --null-mod              -> yes
  --posix-mod             -> yes
  --stdio-mod             -> yes
  --dxt-mod               -> yes
  --heatmap-mod           -> yes
  --mpiio-mod             -> yes
  --apmpi-mod             -> no
  --apmpi-coll-sync       -> no
  --apxc-mod              -> no
  --hdf5-mod              -> yes
  --pnetcdf-mod           -> yes
  --daos-mod              -> no
  --bgq-mod               -> no
  --lustre-mod            -> no
  --mdhim-mod             -> no
  --ldms-mod              -> no
  --rdtscp                -> no
  --exit-wrapper          -> yes

This Darshan Runtime 3.4.7 was built using the following compilers and flags:

  --cc              -> mpicc
  --cppflags        -> -I/home/wliao/ZLIB/1.3.1/include
  --cflags          -> -O0 -g -Wfatal-errors -Wall -I/home/wliao/HDF5/1.14.2/include -I/home/wliao/PnetCDF/1.14.0/include
  --ldflags         -> 
  --libs            -> -lm -lz -lmpi 

  --pre-ld-flags    -> -L/home/wliao/Darshan/DEV/lib  -L/home/wliao/ZLIB/1.3.1/lib -ldarshan -lz -Wl,@/home/wliao/Darshan/DEV/share/ld-opts/darshan-ld-opts
  --post-ld-flags   -> -L/home/wliao/Darshan/DEV/lib -ldarshan  -lz -lrt -lpthread -lm
  --dyn-ld-flags    -> -L/home/wliao/Darshan/DEV/lib  -L/home/wliao/ZLIB/1.3.1/lib -Wl,-rpath=/home/wliao/Darshan/DEV/lib -Wl,-no-as-needed -ldarshan  -L/home/wliao/HDF5/1.14.2/lib -Wl,-rpath=/home/wliao/HDF5/1.14.2/lib -lhdf5
  --log-path        -> /home/wliao/Darshan/LOG
  --log-path-by-env -> DARSHAN_LOG1,DARSHAN_LOG2

  --zlib-path       -> /home/wliao/ZLIB/1.3.1
  --mem-align       -> 8
  --log-hints       -> romio_no_indep_rw=true;cb_nodes=4
  --jobid-env       -> NONE
  --username-env    -> JOHNDOE
  --mod-mem         -> 64
  --name-mem        -> 16
  --hdf5-path       -> /home/wliao/HDF5/1.14.2
  --pnetcdf-path    -> /home/wliao/PnetCDF/1.14.0
  --daos-path       -> 
  --ldms-path       -> 

Command darshan-config --help now shows all available command-line options.

(click to expand)
darshan-config is a utility program to display the build and installation
information of the Darshan runtime library.

Usage: darshan-config [OPTION]

Available values for OPTION include:

  --help                 display this help message and exit
  --all                  display all options
  --cc                   C compiler used to build Darshan
  --cflags               C compiler flags used to build Darshan
  --cppflags             C pre-processor flags used to build Darshan
  --ldflags              Linker flags used to build Darshan
  --libs                 Extra libraries used to build Darshan
  --pre-ld-flags         Linker flags for setting env variable LD_PRELOAD
  --post-ld-flags        Linker flags for statically linking
  --dyn-ld-flags         Linker flags for dynamically linking
  --log-path             Storage locations of Darshan log files
  --log-path-by-env      Comma separated list of environment variables to
                         check for log path location

  --ld-preload           Whether LD_PRELOAD library is enabled
  --cuserid              Whether cuserid() is used at run time
  --group-readable-logs  Whether log files are group readable
  --mmap-logs            Whether to use mmap I/O data to log file
  --null-mod             Whether NULL module is enabled
  --posix-mod            Whether POSIX module is enabled
  --stdio-mod            Whether STDIO module is enabled
  --dxt-mod              Whether DXT module is enabled
  --heatmap-mod          Whether HEATMAP module is enabled
  --mpiio-mod            Whether MPI-IO module is enabled
  --apmpi-mod            Whether AUTOPERF MPI module is enabled
  --apmpi-coll-sync      Whether sync for MPI collectives is enabled
  --apxc-mod             Whether AUTOPERF XC module is enabled
  --hdf5-mod             Whether HDF5 module is enabled
  --pnetcdf-mod          Whether PnetCDF module is enabled
  --daos-mod             Whether DAOS module is enabled
  --bgq-mod              Whether BG/Q module is enabled
  --lustre-mod           Whether Lustre module is enabled
  --mdhim-mod            Whether mdhim module is enabled
  --ldms-mod             Whether to include LDMS for runtime I/O monitoring
  --rdtscp               Frequency of using RDTSCP intrinsic for timing
  --exit-wrapper         Whether to wrap _exit() calls as last ditch shutdown
                         hook for the Darshan library when used in non-MPI mode

  --zlib-path            Root directory path of zlib installation
  --mem-align            Memory alignment in bytes
  --log-hints            List of MPI-IO hints for log file write
  --jobid-env            Name of environment variable that stores the jobid
  --username-env         Name of environment variable that stores the username
  --mod-mem              Maximum runtime memory consumption per process (in
                         MiB) across all instrumentation modules
  --name-mem             Maximum runtime memory consumption per process (in
                         MiB) for storing name records
  --hdf5-path            Installation directory for HDF5.
  --pnetcdf-path         Installation directory for PnetCDF.
  --daos-path            Installation directory for DAOS.
  --ldms-path            Root directory path of LDMS installation

@wkliao wkliao requested a review from carns July 21, 2025 22:28
@wkliao wkliao added the enhancement New feature or request label Jul 21, 2025
@wkliao wkliao force-pushed the darshan-config branch 2 times, most recently from 20500d3 to 0fd7dfe Compare July 22, 2025 00:52
Copy link

@carns carns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, much more thorough than I imagined! I just suggested one additional parameter that I didn't see in the list, because I've recently wished it were easier to see that particular option in someone's build.

echo " --pre-ld-flags -> $PRE_LD_FLAGS"
echo " --post-ld-flags -> $POST_LD_FLAGS"
echo " --dyn-ld-flags -> $DYN_LD_FLAGS"
echo " --log-path -> $DARSHAN_LOG_ALL"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about --with-log-path-by-env? I didn't thoroughly check if all options are represented here, but that one jumped out at me as an important one to see if it is set. It is a little bit of a frustrating option because I think there is a way to override it (even by configuration file) to go back to the conventional log path setup if it has been set. (that may be a separate issue to open; it catches a few Spack users because of the default Spack package options).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that the value set in --with-log-path-by-env will appear
(pre-pended) in --log-path already. For example, if my configure
command is

configure --with-log-path=$HOME/Darshan/LOG \
          --with-log-path-by-env=DARSHAN_LOG1,DARSHAN_LOG2

then, command darshan-config --log-path shows

$DARSHAN_LOG1,$DARSHAN_LOG2,/home/wliao/Darshan/LOG

See the source codes in

if [ "$DARSHAN_LOG_ENV" -a "$DARSHAN_LOG_PATH" ]; then
DARSHAN_LOG_ALL="$DARSHAN_LOG_ENV,$DARSHAN_LOG_PATH"
elif [ "$DARSHAN_LOG_ENV" ]; then
DARSHAN_LOG_ALL=$DARSHAN_LOG_ENV
else
DARSHAN_LOG_ALL=$DARSHAN_LOG_PATH
fi

I think maybe separating them into two is better, less confusing, i.e.

  --log-path        -> /home/wliao/Darshan/LOG
  --log-path-by-env -> $DARSHAN_LOG1,$DARSHAN_LOG2

And also remove the $ before the env variables?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I forgot they were combined. I agree that this is less confusing, thanks.

I don't have a preference for whether the $ is there or not. It was important when they were combined (to differentiate true paths from environment variables) but that doesn't matter if they are split.

Copy link

@carns carns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this. I'll leave it to you to decide whether to include the $ character on the --log-path-by-env values. Otherwise you can merge when ready.

@wkliao wkliao merged commit fc0a1b1 into darshan-hpc:main Aug 4, 2025
6 checks passed
@wkliao wkliao deleted the darshan-config branch August 4, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants